package org.example;

import java.util.Arrays;
import java.util.List;

public class AppInt {

    public static void main(String[] args) {
        method();// 当我们什么都不传时,编译器也会构造一个int数组,传递过去,此时打印args也不为null
        method(1);
        method(2,3);

        List<String> list = Arrays.asList("aa", "bb");
        List<Object> objects = Arrays.asList("aa", "bb", new Person());
        List<Person> tests = Arrays.asList(new Person[]{new Person()});
        List<Object> objects1 = Arrays.asList(new Person[]{new Person()}, new Object());


    }

    public static void method(int... args) {
        System.out.print(args+"-----数组长度:"+args.length);
        if (args.length > 0) {
            System.out.println("----数组中第一个元素是:" + args[0]);
        } else {
            System.out.println("----数组中没有任何元素");
        }

    }
}
